﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using PLACEHR.Web.Utilities;

namespace PLACEHR.Web
{
    public class Global
    {
        public static Dictionary<string, Employee> UserCollection = new Dictionary<string, Employee>();
        public static HRDBEntities Context
        {
            get { return System.Web.HttpContext.Current.Session["DataContext"] as HRDBEntities; }
        }
        public static Employee CurrentUser
        {
            get { return System.Web.HttpContext.Current.Session["CurrUser"] as Employee; }
        }

        public static string LanguageCode
        {
            get
            {
                string lanCode = null;
                if (System.Web.HttpContext.Current.Request.Cookies["Language"] != null)
                {
                    lanCode = System.Web.HttpContext.Current.Request.Cookies["Language"].Value;
                }
                else
                {
                    lanCode = Constants.ZhCode;
                }

                return lanCode;
            }
        }
    }
}